package org.example.test_4_20;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

public class TestMain {
    public static void main(String[] args) {
        //添加浏览器配置
        ChromeOptions options = new ChromeOptions();
        //1)允许任何来源的远程连接
        options.addArguments("--remote-allow-origins=*");
        //创建浏览器驱动对象
        ChromeDriver driver = new ChromeDriver(options);
        //访问百度⽹⻚
        driver.get("https://www.baidu.com");
        //搜索“遇事问春风乄”
        driver.findElement(By.cssSelector("#kw")).sendKeys("遇事问春风乄");
        //找到百度一下并点击
        driver.findElement(By.cssSelector("#su")).click();
        //*[@id="1"]/div/div[1]/h3/a

    }
}
